
#import "PywNavgationController.h"
#import "UIImage+Pyw.h"
#import "UIBarButtonItem+Pyw.h"
#import "PywPaymentInfo.h"
#import "PywCPNotifications.h"
#import "PywSdk+pay.h"
#import "PywMBProgressHUD+Pyw.h"
#import "PywAppInfo.h"

@implementation PywNavgationController{
    UIViewController *_viewController;
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if ([self checkIsExit:viewController]) {
        return;
    }
    _viewController = viewController;
    viewController.hidesBottomBarWhenPushed = YES;
    [super pushViewController:viewController animated:YES];
}

- (BOOL)checkIsExit:(id)VC{
    for (id classObj in self.childViewControllers) {
        Class class = [classObj class];
        if ([VC isKindOfClass:class]) {
            return YES;
        }
    }
    return NO;
}

//-(BOOL)shouldAutorotate{
//    return [[self.viewControllers lastObject] shouldAutorotate];
//}
//
//-(UIInterfaceOrientationMask)supportedInterfaceOrientations {
//    return [[self.viewControllers lastObject] supportedInterfaceOrientations];
//}
//
//- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
//    return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
//}


@end
